<script setup>
import ApplyCom from "@/views/apply/ApplyCom.vue";
import {onMounted, ref} from "vue";
import axios from "axios";
import {ElMessage} from "element-plus";
import UploadCom from "@/views/apply/UploadCom.vue";
const status = ref(1)

onMounted(() => {
  // 查看现在的申请状态 如果是0是还没有审核 显示等待审核 1是通过 直接换到上传音乐页面 2是未通过 还是申请页面
  // const url = '/admin/apply/musician_ok?account=' + localStorage.getItem('account')
  // axios.get(url).then((res) => {
  //
  //   if (res.data.flag) {
  //     status.value = res.data.data
  //   } else {
  //     console.log(res.data.message)
  //   }
  // })
  //   .catch(err => {
  //     console.log(err.data)
  //   })
})
</script>

<template>
  <el-scrollbar class="body">
    <div class="header">
      <div class="logo">
        <img style="position:absolute;left: -6px;top: -6px;width: 40px;height: fit-content" src="../../assets/img/logo.png">
      </div>
      <div class="logo-title">
        <strong>FY音乐</strong> • 开放平台
      </div>
    </div>


    <div v-if="status ===0" style="height: calc(100vh - 60px)">
      <el-result
          style="padding-top: 120px"
          icon="warning"
          title="申请尚未审批"
          sub-title="请耐心等待"
      >
        <template #extra>
          <el-button @click="ElMessage.error('催促失败')" type="primary">催促管理员</el-button>
        </template>
      </el-result>

    </div>
    <UploadCom v-else-if="status === 1"></UploadCom>
    <ApplyCom v-else-if="status === 2"></ApplyCom>

  </el-scrollbar>
</template>

<style scoped>

.logo-title {
  font-weight: 400;
  font-size: 18px;
  color: black;
}
.logo {
  width: 28px;
  height: 28px;
  position: relative;
  background: #ffdfc7;
  border-radius: 50%;
  margin-right: 4px;
}

.header {
  height: 60px;
  display: flex;
  align-items: center;
  padding-left: 50px;
  background: white;
}
.body {
  box-sizing: border-box;
  overflow: hidden;
  background-color: rgb(245, 246, 250);
  font-family: Tahoma,\5fae\8f6f\96c5\9ed1,sans-serif;
}
</style>

